{% extends "registration/base.html" %}
{% load i18n %}

{% block title %}{% translate "Edit your profile" %}{% endblock %}

{% block content %}

    {% if form.errors %}
        <p class="errors">{% translate "Please correct the errors below:" %} {{ form.non_field_errors }}</p>
    {% endif %}

    <h1>{% translate "Edit your profile" %}</h1>

    <form method="post" action="" class="form-input">
        {% csrf_token %}
        <div>
            {% if form.name.errors %}
                <p class="errors">{{ form.name.errors.as_text }}</p>
            {% endif %}
            <p>{{ form.name }}</p>
        </div>

        <div class="form-controls">
            {% if form.email.errors %}
                <p class="errors">{{ form.email.errors.as_text }}</p>
            {% endif %}
            <p>{{ form.email }}</p>
        </div>

        <div class="submit">
            <input class="cta" type="submit" value="{% translate "Save" %}"/>
        </div>
    </form>
{% endblock %}

{% block content-related %}
    <div role="complementary">
        <h2 id="aside-header">{% translate "Help" %}</h2>

        <p>{% translate "Use this form to edit your profile." %}</p>

        <p>{% blocktranslate trimmed with username=user.username %}
            Use whatever name you'd like to be identified with on djangoproject.com. If
            you leave it blank, we'll identify you as <b>{{ username }}</b>, your
            username.{% endblocktranslate %}</p>

        <p>{% blocktranslate trimmed %}
            We hate spam as much as you do. We'll only use it to send you password reset
            emails. We'll also use this email to try to fetch a <a
                href="https://en.gravatar.com/">Gravatar</a>. You can change the image for this
            email at <a href="https://en.gravatar.com/">Gravatar</a>.{% endblocktranslate %}</p>

        <p>
            <a href="{% url 'delete_profile' %}">
                {% translate "Want to delete your account?" %}
            </a>
        </p>
    </div>
{% endblock %}
